home *** CD-ROM | disk | FTP | other *** search
/ Lewis & Clark Interactive Picture CD / Lewis & Clark Interactive Picture CD.iso / mac / Mac Browser / Portfolio Help / bsscdhtm.js < prev    next >
Text File  |  1999-09-03  |  62KB  |  2,022 lines

  1. //////////BSSCDHTML Section 1//////////
  2. // RoboHELP« Dynamic HTML Effects Script
  3. // Copyright ⌐ 1998-1999 Blue Sky Software Corporation.  All rights reserved.
  4.  
  5. // Version=3.55
  6.  
  7. // Warning:  Do not modify this file.  It is generated by RoboHELP« and changes will be overwritten.
  8.  
  9. //{{HH_SYMBOL_SECTION
  10. var HH_ChmFilename = "";
  11. var HH_WindowName = "";
  12. var HH_GlossaryFont = "";
  13. var HH_Glossary = "";
  14. var HH_Avenue = "";
  15. //}}HH_SYMBOL_SECTION
  16.  
  17. var gbNav4 = false;
  18. var gbIE4 = false;
  19. var gbIE = false;
  20. var gbIE5 = false;
  21. var gAgent = navigator.userAgent.toLowerCase(); 
  22. var gbMac = (gAgent.indexOf("mac") != -1);
  23. var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  24.  
  25. var error_count = 0;
  26.  
  27. gbIE = (navigator.appName.indexOf("Microsoft") != -1);
  28. if (parseInt(navigator.appVersion) >= 4) {
  29.     gbNav4 = (navigator.appName == "Netscape");
  30.     gbIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  31.  
  32.     if (gbIE4) {
  33.         if (gAgent.indexOf("msie 5.0") != -1) {
  34.             gbIE5 = true;
  35.         }
  36.     }
  37. }
  38.  
  39. function HHActivateComponents()
  40. {
  41.     if ((HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  42.     {
  43.         var objBody = document.all.tags("BODY")[0];
  44.         objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  45.         if (HHComponentActivator.object)
  46.         {
  47.             HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  48.         }
  49.     }
  50. }
  51.  
  52. var gAmc = new Array();
  53. var BSSCSequenceIndex = 0;
  54.  
  55. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  56. {
  57.     this.el = el;
  58.     this.progressAnimation = progressAnimation;
  59.     this.finishAnimiation = finishAnimiation;
  60.     this.animationDuration = parseFloat(animationDuration);
  61.     this.animationPeriod = animationPeriod;
  62.     this.animationStartTime = (new Date()).getTime();
  63.     this.continueAnimation = true;
  64. }
  65.  
  66. function progressFade(ndx)
  67. {
  68.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  69.     if (percent > 1.0){
  70.         percent = 1.0;
  71.         gAmc[ndx].continueAnimation = false;
  72.     }
  73.     gAmc[ndx].el.filters.alpha.opacity = gAmc[ndx].initialOpacity*(1.0-percent) +  gAmc[ndx].finalOpacity*percent;
  74. }
  75.  
  76. function finishFade(ndx)
  77. {
  78.     gAmc[ndx].el.filters.alpha.opacity = parseInt(gAmc[ndx].finalOpacity);
  79. }
  80.  
  81. function progressTranslation(ndx)
  82. {
  83.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  84.     if (percent > 1.0)    {
  85.         percent = 1.0;
  86.         gAmc[ndx].continueAnimation = false;
  87.     }
  88.     gAmc[ndx].el.style.pixelLeft = gAmc[ndx].startX*(1.0-percent) +  gAmc[ndx].finalX*percent;
  89.     gAmc[ndx].el.style.pixelTop = gAmc[ndx].startY*(1.0-percent) +  gAmc[ndx].finalY*percent;
  90. }
  91. function progressSpiral(ndx)
  92. {
  93.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  94.     if (percent > 1.0)    {
  95.         percent = 1.0;
  96.         gAmc[ndx].continueAnimation = false;
  97.     }
  98.     rf = 1.0 - percent
  99.     t = percent * 2.0*Math.PI
  100.     rx = Math.max(Math.abs(gAmc[ndx].el.initLeft), 200)
  101.     ry = Math.max(Math.abs(gAmc[ndx].el.initTop),  200)
  102.     gAmc[ndx].el.style.pixelLeft = Math.ceil(-rf*Math.cos(t)*rx)
  103.     gAmc[ndx].el.style.pixelTop  = Math.ceil(-rf*Math.sin(t)*ry)
  104.     gAmc[ndx].el.style.visibility="visible"    
  105. }
  106.  
  107. function progressElasticFromRight(ndx)
  108. {
  109.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  110.     if (percent > 1.0)    {
  111.         percent = 1.0;
  112.         gAmc[ndx].continueAnimation = false;
  113.     }
  114.     rf=Math.exp(-percent*7)
  115.     t = percent * 1.5*Math.PI
  116.     rx =Math.abs(gAmc[ndx].el.initLeft)
  117.     gAmc[ndx].el.style.pixelLeft = rf*Math.cos(t)*rx
  118.     gAmc[ndx].el.style.pixelTop = 0
  119.     gAmc[ndx].el.style.visibility="visible"    
  120. }
  121. function progressElasticFromBottom(ndx)
  122. {
  123.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  124.     if (percent > 1.0)    {
  125.         percent = 1.0;
  126.         gAmc[ndx].continueAnimation = false;
  127.     }
  128.     rf=Math.exp(-percent*7)
  129.     t = percent * 1.5*Math.PI
  130.     rx =Math.abs(gAmc[ndx].el.initTop)
  131.     gAmc[ndx].el.style.pixelLeft = 0
  132.     gAmc[ndx].el.style.pixelTop = rf*Math.cos(t)*rx
  133.     gAmc[ndx].el.style.visibility="visible"    
  134. }
  135.  
  136. function progressZoomIn(ndx)
  137. {
  138.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  139.     if (percent > 1.0)    {
  140.         percent = 1;
  141.         gAmc[ndx].continueAnimation = false;
  142.     }
  143.     for (var index=0; index<gAmc[ndx].el.all.length; index++) {
  144.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(50+50*percent) + "%"
  145.     }
  146.     gAmc[ndx].el.posLeft = 100
  147.     gAmc[ndx].el.style.visibility="visible"
  148.  
  149.     if (percent >= 1.0)    {
  150.         finishZoom(ndx);
  151.     }
  152. }
  153.  
  154. function progressZoomOut(ndx)
  155. {
  156.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  157.     if (percent > 1.0)    {
  158.         percent = 1.0;
  159.         gAmc[ndx].continueAnimation = false;
  160.     }
  161.  
  162.     for (var index=0; index<gAmc[ndx].el.all.length; index++)
  163.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(100+200*(1-percent)) + "%"
  164.     gAmc[ndx].el.posLeft = 0
  165.     gAmc[ndx].el.style.visibility="visible"
  166.  
  167.     if (percent >= 1.0)    {
  168.         finishZoom(ndx);
  169.     }
  170. }
  171. function finishTranslation(ndx)
  172. {
  173.     gAmc[ndx].el.style.pixelLeft = parseInt(gAmc[ndx].finalX);
  174.     gAmc[ndx].el.style.pixelTop = parseInt(gAmc[ndx].finalY);
  175. }
  176. function finishZoom(ndx)
  177. {
  178.     for (i=0; i<gAmc[ndx].el.all.length; i++)
  179.         gAmc[ndx].el.all[i].style.fontSize = gAmc[ndx].OldFont
  180.  
  181.  
  182. function animationPump(ndx)
  183. {
  184.     gAmc[ndx].progressAnimation(ndx);
  185.     if (gAmc[ndx].continueAnimation)
  186.         gAmc[ndx].tm = setTimeout("animationPump(" + ndx + ");", gAmc[ndx].animationPeriod);
  187. }
  188.  
  189. function clearAnimations()
  190. {
  191.     for (var index=0; index<gAmc.length; index++) {
  192.         gAmc[index].finishAnimiation(index);
  193.         clearTimeout(gAmc[index].tm);
  194.     }
  195.     gAmc = new Array();
  196. }
  197.  
  198. function startNextAnimationSet()
  199. {
  200.     clearAnimations();
  201.     bStarted = false;
  202.     bFound = false
  203.  
  204.     // Determine the next sequence number
  205.     divElements = document.all.tags("DIV");
  206.     for (var index = 0; index < divElements.length; index++) 
  207.     {
  208.         el = divElements[index];
  209.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  210.         if(null != objectOrder)
  211.         {
  212.             objectOrder = parseInt(objectOrder);
  213.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  214.             {
  215.                 minBSSCSequenceIndexFound = objectOrder;
  216.                 bFound = true;
  217.             }
  218.         }
  219.     }
  220.  
  221.     if (bFound)
  222.     {
  223.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  224.         bStarted = startAnimationSet(BSSCSequenceIndex);
  225.     }
  226. }
  227.  
  228. function getOffsetFromTopOfBrowser(el)
  229. {
  230.     if (null == el.offsetParent)
  231.         return el.offsetTop;
  232.     else
  233.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  234. }
  235.  
  236. function startAnimationSet(ndx)
  237. {
  238.     var m = 0;
  239.     bStarted = false;
  240.  
  241.     // Find document elements with "BSSCAnimationType" attribute
  242.     divElements = document.all.tags("DIV");
  243.     for (var index = 0; index < divElements.length; index++)
  244.     {
  245.         el = divElements[index];
  246.         
  247.         animationType = el.getAttribute("BSSCAnimationType", false);
  248.         if(null != animationType)
  249.         {
  250.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  251.             frameCount = el.getAttribute("BSSCFrameCount", false);
  252.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  253.  
  254.             // Stop any currently running RevealTrans filters
  255.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1 && gbWindows)
  256.                 el.filters.RevealTrans.stop();  
  257.             // Filter on ndx
  258.             if (0 == ndx && null == sequenceIndex ||
  259.                 ndx == parseInt(sequenceIndex))
  260.             {
  261.                 if ("FlyInFromRight" == animationType)
  262.                 {
  263.                     animationDuration = el.getAttribute("BSSCDuration", false);
  264.                     if (null == animationDuration)
  265.                         animationDuration = 1000; // default to 1s
  266.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  267.                     gAmc[m].startX = document.body.clientWidth + document.body.scrollLeft;
  268.                     gAmc[m].startY = 0;
  269.                     gAmc[m].finalX = 0;
  270.                     gAmc[m].finalY = 0;
  271.                     animationPump(m++);
  272.                     bStarted = true;
  273.                 }
  274.                 if ("FlyOutToRight" == animationType)
  275.                 {
  276.                     animationDuration = el.getAttribute("BSSCDuration", false);
  277.                     if (null == animationDuration)
  278.                         animationDuration = 1000; // default to 1s
  279.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  280.                     gAmc[m].startX = 0;
  281.                     gAmc[m].startY = 0;
  282.                     gAmc[m].finalX = document.body.clientWidth + document.body.scrollWidth;
  283.                     gAmc[m].finalY = 0;
  284.                     animationPump(m++);
  285.                     bStarted = true;
  286.                 }
  287.                 if ("FlyInFromLeft" == animationType)
  288.                 {
  289.                     animationDuration = el.getAttribute("BSSCDuration", false);
  290.                     if (null == animationDuration)
  291.                         animationDuration = 1000; // default to 1s
  292.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  293.                     {
  294.                         if ("left" == el.children[childIndex].style.textAlign)
  295.                             el.children[childIndex].style.textAlign = "right";
  296.                     }
  297.                     pixelsToTranslate = document.body.clientWidth;
  298.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  299.                     gAmc[m].startX = -(document.body.clientWidth + document.body.scrollLeft);
  300.                     gAmc[m].startY = 0;
  301.                     gAmc[m].finalX = 0;
  302.                     gAmc[m].finalY = 0;
  303.                     animationPump(m++);
  304.                     bStarted = true;
  305.                 }
  306.                 if ("FlyOutToLeft" == animationType)
  307.                 {
  308.                     animationDuration = el.getAttribute("BSSCDuration", false);
  309.                     if (null == animationDuration)
  310.                         animationDuration = 1000; // default to 1s
  311.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  312.                     {
  313.                         if ("left" == el.children[childIndex].style.textAlign)
  314.                             el.children[childIndex].style.textAlign = "right";
  315.                     }
  316.                     pixelsToTranslate = document.body.clientWidth;
  317.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  318.                     gAmc[m].startX = 0;
  319.                     gAmc[m].startY = 0;
  320.                     gAmc[m].finalX = -(document.body.clientWidth + document.body.scrollWidth);
  321.                     gAmc[m].finalY = 0;
  322.                     animationPump(m++);
  323.                     bStarted = true;
  324.                 }
  325.                 if ("FlyInFromBottom" == animationType)
  326.                 {
  327.                     animationDuration = el.getAttribute("BSSCDuration", false);
  328.                     if (null == animationDuration)
  329.                         animationDuration = 1000; // default to 1s
  330.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  331.                     gAmc[m].startX = 0;
  332.                     gAmc[m].startY = document.body.clientHeight + document.body.scrollTop;
  333.                     gAmc[m].finalX = 0;
  334.                     gAmc[m].finalY = 0;
  335.                     animationPump(m++);
  336.                     bStarted = true;
  337.                 }
  338.                 if ("FlyOutToBottom" == animationType)
  339.                 {
  340.                     animationDuration = el.getAttribute("BSSCDuration", false);
  341.                     if (null == animationDuration)
  342.                         animationDuration = 1000; // default to 1s
  343.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  344.                     gAmc[m].startX = 0;
  345.                     gAmc[m].startY = 0;
  346.                     gAmc[m].finalX = 0;
  347.                     gAmc[m].finalY = document.body.clientHeight + document.body.scrollHeight;
  348.                     animationPump(m++);
  349.                     bStarted = true;
  350.                 }
  351.                 if ("FlyInFromTop" == animationType)
  352.                 {
  353.                     animationDuration = el.getAttribute("BSSCDuration", false);
  354.                     if (null == animationDuration)
  355.                         animationDuration = 1000; // default to 1s
  356.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  357.                     gAmc[m].startX = 0;
  358.                     gAmc[m].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  359.                     gAmc[m].finalX = 0;
  360.                     gAmc[m].finalY = 0;
  361.                     animationPump(m++);
  362.                     bStarted = true;
  363.                 }
  364.                 if ("FlyOutToTop" == animationType)
  365.                 {
  366.                     animationDuration = el.getAttribute("BSSCDuration", false);
  367.                     if (null == animationDuration)
  368.                         animationDuration = 1000; // default to 1s
  369.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  370.                     gAmc[m].startX = 0;
  371.                     gAmc[m].startY = 0;
  372.                     gAmc[m].finalX = 0;
  373.                     gAmc[m].finalY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  374.                     animationPump(m++);
  375.                     bStarted = true;
  376.                 }
  377.                 if ("FlyInFromBottomRight" == animationType)
  378.                 {
  379.                     animationDuration = el.getAttribute("BSSCDuration", false);
  380.                     if (null == animationDuration)
  381.                         animationDuration = 1000; // default to 1s
  382.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  383.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  384.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  385.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  386.                     gAmc[m].startX = pixelsToTranslate;
  387.                     gAmc[m].startY = pixelsToTranslate;
  388.                     gAmc[m].finalX = 0;
  389.                     gAmc[m].finalY = 0;
  390.                     animationPump(m++);
  391.                     bStarted = true;
  392.                 }
  393.                 if ("FlyOutToBottomRight" == animationType)
  394.                 {
  395.                     animationDuration = el.getAttribute("BSSCDuration", false);
  396.                     if (null == animationDuration)
  397.                         animationDuration = 1000; // default to 1s
  398.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  399.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  400.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  401.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  402.                     gAmc[m].startX = 0;
  403.                     gAmc[m].startY = 0;
  404.                     gAmc[m].finalX = pixelsToTranslate;
  405.                     gAmc[m].finalY = pixelsToTranslate;
  406.                     animationPump(m++);
  407.                     bStarted = true;
  408.                 }
  409.                 if ("FlyInFromTopRight" == animationType)
  410.                 {
  411.                     animationDuration = el.getAttribute("BSSCDuration", false);
  412.                     if (null == animationDuration)
  413.                         animationDuration = 1000; // default to 1s
  414.                     pixelsToTranslate = document.body.clientWidth;
  415.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  416.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  417.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  418.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  419.                     gAmc[m].startX = pixelsToTranslate;
  420.                     gAmc[m].startY = -pixelsToTranslate;
  421.                     gAmc[m].finalX = 0;
  422.                     gAmc[m].finalY = 0;
  423.                     animationPump(m++);
  424.                     bStarted = true;
  425.                 }
  426.                 if ("FlyOutToTopRight" == animationType)
  427.                 {
  428.                     animationDuration = el.getAttribute("BSSCDuration", false);
  429.                     if (null == animationDuration)
  430.                         animationDuration = 1000; // default to 1s
  431.                     pixelsToTranslate = document.body.clientWidth;
  432.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  433.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  434.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  435.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  436.                     gAmc[m].startX = 0;
  437.                     gAmc[m].startY = 0;
  438.                     gAmc[m].finalX = pixelsToTranslate;
  439.                     gAmc[m].finalY = -pixelsToTranslate;
  440.                     animationPump(m++);
  441.                     bStarted = true;
  442.                 }
  443.                 if ("FlyInFromTopLeft" == animationType)
  444.                 {
  445.                     animationDuration = el.getAttribute("BSSCDuration", false);
  446.                     if (null == animationDuration)
  447.                         animationDuration = 1000; // default to 1s
  448.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  449.                     {
  450.                         if ("left" == el.children[childIndex].style.textAlign)
  451.                             el.children[childIndex].style.textAlign = "right";
  452.                     }
  453.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  454.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  455.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  456.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  457.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  458.                     gAmc[m].startX = -pixelsToTranslate;
  459.                     gAmc[m].startY = -pixelsToTranslate;
  460.                     gAmc[m].finalX = 0;
  461.                     gAmc[m].finalY = 0;
  462.                     animationPump(m++);
  463.                     bStarted = true;
  464.                 }
  465.                 if ("FlyOutToTopLeft" == animationType)
  466.                 {
  467.                     animationDuration = el.getAttribute("BSSCDuration", false);
  468.                     if (null == animationDuration)
  469.                         animationDuration = 1000; // default to 1s
  470.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  471.                     {
  472.                         if ("left" == el.children[childIndex].style.textAlign)
  473.                             el.children[childIndex].style.textAlign = "right";
  474.                     }
  475.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  476.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  477.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  478.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  479.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  480.                     gAmc[m].startX = 0;
  481.                     gAmc[m].startY = 0;
  482.                     gAmc[m].finalX = -pixelsToTranslate;
  483.                     gAmc[m].finalY = -pixelsToTranslate;
  484.                     animationPump(m++);
  485.                     bStarted = true;
  486.                 }
  487.                 if ("FlyInFromBottomLeft" == animationType)
  488.                 {
  489.                     animationDuration = el.getAttribute("BSSCDuration", false);
  490.                     if (null == animationDuration)
  491.                         animationDuration = 1000; // default to 1s
  492.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  493.                     {
  494.                         if ("left" == el.children[childIndex].style.textAlign)
  495.                             el.children[childIndex].style.textAlign = "right";
  496.                     }
  497.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  498.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  499.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  500.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  501.                     gAmc[m].startX = -pixelsToTranslate;
  502.                     gAmc[m].startY = pixelsToTranslate;
  503.                     gAmc[m].finalX = 0;
  504.                     gAmc[m].finalY = 0;
  505.                     animationPump(m++);
  506.                     bStarted = true;
  507.                 }
  508.                 if ("FlyOutToBottomLeft" == animationType)
  509.                 {
  510.                     animationDuration = el.getAttribute("BSSCDuration", false);
  511.                     if (null == animationDuration)
  512.                         animationDuration = 1000; // default to 1s
  513.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  514.                     {
  515.                         if ("left" == el.children[childIndex].style.textAlign)
  516.                             el.children[childIndex].style.textAlign = "right";
  517.                     }
  518.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  519.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  520.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  521.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  522.                     gAmc[m].startX = 0;
  523.                     gAmc[m].startY = 0;
  524.                     gAmc[m].finalX = -pixelsToTranslate;
  525.                     gAmc[m].finalY = pixelsToTranslate;
  526.                     animationPump(m++);
  527.                     bStarted = true;
  528.                 }
  529.                 if ("FadeIn" == animationType)
  530.                 {
  531.                     if (gbWindows)
  532.                     {
  533.                         animationDuration = el.getAttribute("BSSCDuration", false);
  534.                         if (null == animationDuration)
  535.                             animationDuration = 1000; // default to 1s
  536.                         finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  537.                         if (null == finalOpacity)
  538.                             finalOpacity = 100;
  539.                         initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  540.                         if (null == initialOpacity)
  541.                             initialOpacity = 0;
  542.                         gAmc[m] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  543.                         el.filters.opacity = initialOpacity;
  544.                         gAmc[m].initialOpacity = initialOpacity;
  545.                         gAmc[m].finalOpacity = finalOpacity;
  546.                         animationPump(m++);
  547.                         bStarted = true;
  548.                     } else {
  549.                         el.style.visibility = "";
  550.                     }
  551.                 }
  552.                 if ("Spiral" == animationType)
  553.                 {
  554.                     animationDuration = el.getAttribute("BSSCDuration", false);
  555.                     if (null == animationDuration)
  556.                         animationDuration = 1000; // default to 1s
  557.  
  558.                     gAmc[m] = new animationContext(el, progressSpiral, finishTranslation, animationDuration, 10);
  559.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  560.                     gAmc[m].el.initTop = document.body.scrollTop+el.offsetTop+document.body.clientHeight;
  561.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  562.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  563.                     gAmc[m].finalX = 0;
  564.                     gAmc[m].finalY = 0;
  565.                     gAmc[m].steps = 0;
  566.                     animationPump(m++);
  567.                     bStarted = true;
  568.                 }
  569.                 if ("ElasticFromRight" == animationType)
  570.                 {
  571.                     animationDuration = el.getAttribute("BSSCDuration", false);
  572.                     if (null == animationDuration)
  573.                         animationDuration = 1000; // default to 1s
  574.                     gAmc[m] = new animationContext(el, progressElasticFromRight, finishTranslation, animationDuration, 10);
  575.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  576.                     gAmc[m].el.initTop = gAmc[m].el.posTop;
  577.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  578.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  579.                     gAmc[m].finalX = 0;
  580.                     gAmc[m].finalY = 0;
  581.                     gAmc[m].steps = 0;
  582.                     animationPump(m++);
  583.                     bStarted = true;
  584.                 }
  585.                 if ("ElasticFromBottom" == animationType)
  586.                 {
  587.                     animationDuration = el.getAttribute("BSSCDuration", false);
  588.                     if (null == animationDuration)
  589.                         animationDuration = 1000; // default to 1s
  590.                     gAmc[m] = new animationContext(el, progressElasticFromBottom, finishTranslation, animationDuration, 10);
  591.                     gAmc[m].el.initLeft = gAmc[m].el.posLeft;
  592.                     gAmc[m].el.initTop = document.body.scrollTop-el.offsetTop-el.offsetHeight;
  593.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  594.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  595.                     gAmc[m].finalX = 0;
  596.                     gAmc[m].finalY = 0;
  597.                     gAmc[m].steps = 0;
  598.                     animationPump(m++);
  599.                     bStarted = true;
  600.                 }
  601.                 if ("ZoomIn" == animationType)
  602.                 {
  603.                     animationDuration = el.getAttribute("BSSCDuration", false);
  604.                     if (null == animationDuration)
  605.                         animationDuration = 1000; // default to 1s
  606.                     gAmc[m] = new animationContext(el, progressZoomIn, finishZoom, animationDuration, 10);
  607.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  608.                     animationPump(m++);
  609.                     bStarted = true;
  610.                 }
  611.                 if ("ZoomOut" == animationType)
  612.                 {
  613.                     animationDuration = el.getAttribute("BSSCDuration", false);
  614.                     if (null == animationDuration)
  615.                         animationDuration = 1000; // default to 1s
  616.                     gAmc[m] = new animationContext(el, progressZoomOut, finishZoom, animationDuration, 10);
  617.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  618.                     animationPump(m++);
  619.                     bStarted = true;
  620.                 }
  621.                 if ("RevealTrans" == animationType)
  622.                 {
  623.                     if (gbWindows) {
  624.                         Duration = el.getAttribute("BSSCDuration", false);
  625.                         if (null == Duration)
  626.                             Duration = 1000; // default to 1s
  627.                         Transition = el.getAttribute("BSSCTransition", false);
  628.                         if (null == Transition)
  629.                             Transition = 0;
  630.                         el.style.filter = "RevealTrans();";
  631.                         el.filters.RevealTrans.Transition = Transition;
  632.                         el.filters.RevealTrans.apply();
  633.                         el.style.visibility = ""; 
  634.                         el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  635.                         bStarted = true;
  636.                     } else {
  637.                         el.style.visibility = "";
  638.                     }
  639.                 }
  640.             }
  641.         }
  642.     }
  643.     return bStarted;
  644. }
  645.  
  646. function ApplyTextFormatting(divEl, childEl)
  647. {
  648.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  649.  
  650.     // Text Change
  651.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  652.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  653.     {
  654.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  655.         childEl.style.color = hoverColor;
  656.     }
  657.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  658.     if (null != hoverFontName && hoverFontName != "*Default*")
  659.     {
  660.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  661.         if (null != hoverFontFamily)
  662.         {
  663.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  664.             childEl.style.fontFamily = hoverFontFamily;
  665.         }
  666.     }
  667.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  668.     {
  669.         if (null != hoverFontSize && hoverFontSize != "*")
  670.         {
  671.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  672.             childEl.style.fontSize = hoverFontSize + "pt";
  673.         }
  674.     }
  675.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  676.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  677.     {
  678.         if ("Italic" == hoverFontStyle)
  679.         {
  680.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  681.             childEl.style.fontStyle = "italic";
  682.         }
  683.         else if ("Bold" == hoverFontStyle)
  684.         {
  685.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  686.             childEl.style.fontWeight = "bold";
  687.         }
  688.         else if ("Bold Italic" == hoverFontStyle)
  689.         {
  690.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  691.             childEl.style.fontStyle = "italic";
  692.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  693.             childEl.style.fontWeight = "bold";
  694.         }
  695.     }
  696.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  697.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  698.     {
  699.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  700.         childEl.style.textDecoration = "underline";
  701.     }
  702. }
  703.  
  704. function RemoveTextFormatting(el)
  705. {
  706.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  707.     if (null != originalColor)
  708.         el.style.color = originalColor;
  709.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  710.     if (null != originalFontFamily)
  711.         el.style.fontFamily = originalFontFamily;
  712.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  713.     if (null != originalFontSize)
  714.         el.style.fontSize = originalFontSize;
  715.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  716.     if (null != originalFontStyle)
  717.         el.style.fontStyle = originalFontStyle;
  718.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  719.     if (null != originalFontWeight)
  720.         el.style.fontWeight = originalFontWeight;
  721.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  722.     if (null != originalTextDecoration)
  723.         el.style.textDecoration = originalTextDecoration;
  724. }
  725.  
  726. function BSSCOnMouseOver(el)
  727. {
  728.     // Text Formatting
  729.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  730.     if (null != hoverColor)
  731.         for (var index=0; index<el.all.length; index++)
  732.             ApplyTextFormatting(el, el.all[index]);
  733.  
  734.     // Glow
  735.     glowColor = el.getAttribute("BSSCGlowColor", false);
  736.     if (null != glowColor)
  737.     {
  738.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  739.         if (null == glowStrength)
  740.             glowStrength = "3";
  741.         glowColorName = el.getAttribute("BSSCGlowColorName");
  742.         if ("Default" == glowColorName)
  743.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  744.         else
  745.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  746.     }
  747. }
  748.  
  749. function BSSCOnMouseOut(el)
  750. {
  751.     // Text Formatting
  752.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  753.     if (null != hoverColor)
  754.         for (var index=0; index<el.all.length; index++)
  755.             RemoveTextFormatting(el.all[index]);
  756.  
  757.     // Glow
  758.     glowColor = el.getAttribute("BSSCGlowColor", false);
  759.     if (null != glowColor)
  760.         el.style.filter="";
  761. }
  762.  
  763. function doStaticEffects()
  764. {
  765.     divElements = document.all.tags("DIV");
  766.     for (var index = 0; index < divElements.length; index++)
  767.     {
  768.         el = divElements[index];
  769.         
  770.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  771.         if (null != dropShadowColor)
  772.         {
  773.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  774.             if (null == dropShadowXOffset)
  775.                 dropShadowXOffset = 0;
  776.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  777.             if (null == dropShadowYOffset)
  778.                 dropShadowYOffset = 0;
  779.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  780.             if ("Default" == dropShadowColorName)
  781.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  782.             else
  783.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  784.         }
  785.     }
  786. }
  787.  
  788. function drop( targetId )
  789.     target = document.all( targetId );
  790.     if (target.style.display == 'none') {
  791.        target.style.display = "" ;
  792.     } else {
  793.        target.style.display = "none";
  794.     }
  795.     event.cancelBubble = true;
  796. }
  797.  
  798. function checkParent(src,dest)
  799. {
  800.     //Search for a specific parent of the current element.
  801.     while(src !=null)
  802.     {
  803.         if(src.tagName == dest)
  804.         {
  805.             return src;
  806.         }
  807.         src = src.parentElement;
  808.     }
  809.     return null;
  810. }
  811.  
  812. //Generic Display code
  813. function outline2()
  814. {
  815.     //Expand or collapse if a list item is clicked.
  816.     var open = event.srcElement;
  817.  
  818.     //Verify that the tag which was clicked was either the 
  819.     //trigger tag or nested within a trigger tag.
  820.     var el = checkParent(open,"CITE");
  821.     if(null != el)
  822.     {    
  823.         var incr=0;
  824.         var elmPos = 0;
  825.         var parentSpan;
  826.         var fBreak
  827.  
  828.         //Get the position of the element which was clicked
  829.         elemPos = window.event.srcElement.sourceIndex;
  830.  
  831.         //Search for a SPAN tag
  832.         for (parentSpan = window.event.srcElement.parentElement; parentSpan!=null;    parentSpan = parentSpan.parentElement) 
  833.         {
  834.             //test if already at a span tag 
  835.             if (parentSpan.tagName=="SPAN") {
  836.                 incr=1;
  837.                 break;
  838.             }
  839.             
  840.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  841.             //we perform this test because nested lists require special handling
  842.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  843.             {
  844.                 //Determine where the span to be expanded is.  
  845.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  846.                 {    
  847.                     //verify we are at an expandable Div tag
  848.                     if(document.all(elemPos+incr).tagName=="SPAN" && (document.all(elemPos+incr).className=="expanded" || document.all(elemPos+incr).className=="glossexpanded" || document.all(elemPos+incr).className=="glosscollapsed" || document.all(elemPos+incr).className=="collapsed"))
  849.                     {
  850.                         fBreak=1;
  851.                         break;
  852.                     }
  853.                     else if(document.all(elemPos+incr).tagName=="LI")
  854.                     {
  855.                         //If the next tag following the list item (li) is another list item(li) return in order to prevent accidentally opening the next span in the list
  856.                         return;
  857.                     }
  858.                 }
  859.             }
  860.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  861.             if(fBreak==1)
  862.             {
  863.                 break;
  864.             }
  865.         }
  866.     }
  867.     else
  868.     {
  869.         return;
  870.     }
  871.  
  872.     //Now that we've identified the span, expand or collapse it
  873.     if(document.all(elemPos+incr) == null) {    
  874.         return;
  875.     } else if(document.all(elemPos+incr).className=="collapsed") {
  876.         document.all(elemPos+incr).className="expanded";
  877.     } else if(document.all(elemPos+incr).className=="expanded")  {
  878.         document.all(elemPos+incr).className="collapsed";
  879.     } else if(document.all(elemPos+incr).className=="glosscollapsed") {
  880.         document.all(elemPos+incr).className="glossexpanded";
  881.     } else if(document.all(elemPos+incr).className=="glossexpanded") {
  882.         document.all(elemPos+incr).className="glosscollapsed";
  883.     } else    {
  884.         return;
  885.     }
  886.     event.cancelBubble = true;
  887. }
  888.  
  889.  
  890. //////////BSSCDHTML Section 2//////////
  891.  
  892. function RemoveNavBar()
  893. {
  894.     // See if we are in a popup and if so remove the NavBar
  895.     if (BSSCPopup_IsPopup()) {
  896.  
  897.         if (gbIE4) {
  898.             var tempColl = document.all.tags("DIV");
  899.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  900.                 if (tempColl(iDiv).id == "NavBar") {
  901.                     tempColl(iDiv).style.visibility = gBsStyVisHide;
  902.                     if (gbIE5) {
  903.                         tempColl(iDiv).style.position = "absolute";
  904.                     }
  905.                     tempColl(iDiv).style.pixelTop = "-100px";
  906.                     break;
  907.                 }
  908.             }
  909.         } else if (gbNav4) {
  910.             for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  911.                 if (document.layers[iLayer].id == "NavBar") {
  912.                     document.layers[iLayer].visibility = gBsStyVisHide;
  913.                 }
  914.             }
  915.             if ((document.images.length > 0) && (document.images[0].src.indexOf('bsscnav1.gif') != -1)) {
  916.                 document.links[0].href = "javascript:void(null);";
  917.             }
  918.         }
  919.     }
  920.     
  921.     return;
  922. }
  923.  
  924.  
  925.  
  926. //////////////////////////////////////////////////////////////////////////////////////////////
  927. //
  928. //    Begin DHTML Popup Functions
  929. //
  930. //////////////////////////////////////////////////////////////////////////////////////////////
  931. //variables used to isolate the browser type
  932. var gBsDoc            = null;            
  933. var gBsSty            = null;
  934. var gBsHtm            = null;
  935. var gBsStyVisShow    = null;
  936. var gBsStyVisHide    = null;
  937. var gBsClientWidth    = 640;
  938. var gBsClientHeight = 480;
  939. var gBsBrowser        = null;
  940.  
  941. //the browser information itself
  942. function _BSPSBrowserItself()
  943. {
  944.     var agent  = navigator.userAgent.toLowerCase();
  945.     this.major = parseInt(navigator.appVersion);
  946.     this.minor = parseFloat(navigator.appVersion);
  947.     this.ns    = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  948.     this.ns2   = ((this.ns) && (this.major == 2));
  949.     this.ns3   = ((this.ns) && (this.major == 3));
  950.     this.ns4   = ((this.ns) && (this.major >= 4));
  951.     this.ie       = (agent.indexOf("msie") != -1);
  952.     this.ie3   = ((this.ie) && (this.major == 2));
  953.     this.ie4   = ((this.ie) && (this.major >= 4));
  954.     this.op3   = (agent.indexOf("opera") != -1);
  955.  
  956.     if (this.ns4)
  957.     {
  958.         gBsDoc        = "document";
  959.         gBsSty        = "";
  960.         gBsHtm        = ".document";
  961.         gBsStyVisShow    = "show";
  962.         gBsStyVisHide    = "hide";
  963.  
  964.     }
  965.     else if (this.ie4)
  966.     {
  967.         gBsDoc         = "document.all";
  968.         gBsSty         = ".style";
  969.         gBsHtm         = "";
  970.         gBsStyVisShow    = "visible";
  971.         gBsStyVisHide    = "hidden";
  972.     }
  973. }
  974.  
  975. //Here is the browser type 
  976. function _BSPSGetBrowserInfo()
  977. {
  978.     gBsBrowser    = new _BSPSBrowserItself();
  979. }
  980.  
  981. //Get client size info
  982. function _BSPSGetClientSize()
  983. {
  984.     if (gBsBrowser.ns4)
  985.     {
  986.         gBsClientWidth    = innerWidth;
  987.         gBsClientHeight = innerHeight;
  988.  
  989.     }
  990.     else if (gBsBrowser.ie4)
  991.     {
  992.         gBsClientWidth    = document.body.clientWidth;
  993.         gBsClientHeight = document.body.clientHeight;
  994.     }
  995. }
  996.  
  997.  
  998. var gstrPopupID = 'BSSCPopup';
  999. var gstrPopupShadowID = 'BSSCPopupShadow';
  1000. var gstrPopupTopicID = 'BSSCPopupTopic';
  1001. var gstrPopupIFrameID = 'BSSCPopupIFrame';
  1002. var gstrPopupIFrameName = 'BSSCPopupIFrameName';
  1003.  
  1004. var gstrPopupSecondWindowName = 'BSSCPopup';
  1005.  
  1006. var    gPopupDiv = null;
  1007. var gPopupDivStyle = null;
  1008. var    gPopupShadow = null;
  1009. var    gPopupTopic = null;
  1010. var gPopupIFrame = null;
  1011. var gPopupIFrameStyle = null;
  1012. var gPopupWindow = null;
  1013. var gnPopupClickX = 0;
  1014. var gnPopupClickY = 0;
  1015.  
  1016. var gbPopupTimeoutExpired = false;
  1017.  
  1018. if (BSSCPopup_IsPopup()) {
  1019.     document.write("<base target=\"_parent\">");
  1020. }
  1021.  
  1022. function DHTMLPopupSupport()
  1023. {
  1024.     if ((gbIE4) && (!gbMac)) {
  1025.         return true;
  1026.     }
  1027.     return false;
  1028. }
  1029.  
  1030.  
  1031.  
  1032. function BSSCPopup_IsPopup()
  1033. {
  1034.     if (DHTMLPopupSupport() && (this.name == gstrPopupIFrameName)) {
  1035.         return true;
  1036.     } else if ((gbNav4 || gbIE4) && (this.name == gstrPopupID)) {
  1037.         return true;
  1038.     } else {
  1039.         return false;
  1040.     }
  1041. }
  1042.  
  1043. function _BSSCCreatePopupDiv()
  1044. {
  1045.     if (gPopupDiv == null) {
  1046.         if (DHTMLPopupSupport()) {
  1047.             document.write("<DIV ID='" + gstrPopupID + "' STYLE='position:absolute; width:0; height:0; top:-100; left:0; z-index:600; visibility:hidden;'>");
  1048.             document.write("<DIV ID='" + gstrPopupShadowID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#C0C0C0;\"></DIV>");
  1049.             document.write("<DIV ID='" + gstrPopupTopicID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#FFFFFF;border:1px #000000 outset;\">");
  1050.             document.write("<IFRAME ID='" + gstrPopupIFrameID + "' name='" + gstrPopupIFrameName + "' frameborder=0 scrolling=auto></IFRAME>");
  1051.             document.write("</DIV></DIV>");
  1052.             var tempColl = document.all.tags("DIV");
  1053.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  1054.                 if (tempColl(iDiv).id == gstrPopupID) {
  1055.                     gPopupDiv = tempColl(iDiv);
  1056.                 }
  1057.                 if (tempColl(iDiv).id == gstrPopupShadowID) {
  1058.                     gPopupShadow = tempColl(iDiv);
  1059.                 }
  1060.                 if (tempColl(iDiv).id == gstrPopupTopicID) {
  1061.                     gPopupTopic = tempColl(iDiv);
  1062.                 }
  1063.             }
  1064.             
  1065.             gPopupIFrame = eval("gPopupDiv.document.frames['" + gstrPopupIFrameName + "']");
  1066.             gPopupDivStyle = eval("gPopupDiv" + gBsSty);
  1067.             gPopupIFrameStyle = eval(gBsDoc + "['" + gstrPopupIFrameName + "']" + gBsSty);
  1068.         }
  1069.     }
  1070. }
  1071.  
  1072. function BSSCPopup_Timeout()
  1073. {
  1074.     if ((gPopupIFrame.document.readyState == "complete") &&
  1075.         (gPopupIFrame.document.body != null)) {
  1076.         BSSCPopup_TimeoutReal();
  1077.     } else {
  1078.         setTimeout("BSSCPopup_Timeout()", 100);
  1079.     }
  1080. }
  1081.  
  1082. function BSSCPopup_TimeoutReal()
  1083. {
  1084.     window.gbPopupTimeoutExpired = true;
  1085.  
  1086.     if (gPopupIFrame.document) {
  1087.         gPopupIFrame.document.body.onclick = BSSCPopupClicked;
  1088.     }
  1089.     document.onmousedown = BSSCPopupParentClicked;
  1090. }
  1091.  
  1092. function BSPSPopupTopicWinHelp(strURL)
  1093. {
  1094.     _BSSCPopup(strURL);
  1095.     return;
  1096. }
  1097.  
  1098. function _BSSCPopup(strURL)
  1099. {
  1100.     if (DHTMLPopupSupport()) {
  1101.  
  1102.         // If we are already in a popup, replace the contents
  1103.         if (BSSCPopup_IsPopup()) {
  1104.  
  1105.             location.href = strURL;
  1106.             parent.window.gbPopupTimeoutExpired = false;
  1107.             if (gbMac) {
  1108.                 setTimeout("BSSCPopup_AfterLoad()", 400);
  1109.             } else {
  1110.                 setTimeout("BSSCPopup_AfterLoad()", 100);
  1111.             }
  1112.  
  1113.         } else {
  1114.  
  1115.             // Load the requested URL into the IFRAME
  1116.             gPopupIFrame.location.href = strURL;
  1117.             window.gbPopupTimeoutExpired = false;
  1118.             if (gbMac) {
  1119.                 setTimeout("BSSCPopup_AfterLoad()", 400);
  1120.             } else {
  1121.                 setTimeout("BSSCPopup_AfterLoad()", 100);
  1122.             }
  1123.         }
  1124.  
  1125.     } else {
  1126.  
  1127.         if (window.name == gstrPopupSecondWindowName) {
  1128.             window.location = strURL;
  1129.         } else {
  1130.  
  1131.             BSSCHidePopupWindow();
  1132.             var nX = 0;
  1133.             var nY = 0;
  1134.             var nHeight = 300;
  1135.             var nWidth = 400;
  1136.             _BSPSGetClientSize();
  1137.             if (gBsBrowser.ns4) {
  1138.                 nX = window.screenX + (window.outerWidth - window.innerWidth) + window.gnPopupClickX;
  1139.                 nY = window.screenY + (window.outerHeight - window.innerHeight) + window.gnPopupClickY;
  1140.                 if (nY + nHeight + 40 > screen.availHeight) {
  1141.                     nY = screen.availHeight - nHeight - 40;
  1142.                 }
  1143.                 if (nX + nWidth + 40 > screen.availWidth) {
  1144.                     nX = screen.availWidth - nWidth - 40;
  1145.                 }
  1146.             } else {
  1147.                 nX = window.gnPopupClickX;
  1148.                 nY = window.gnPopupClickX;
  1149.             }
  1150.  
  1151.             // Launch a separate window
  1152.             var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,";
  1153.             strParam += "height=" + nHeight + ",width=" + nWidth;
  1154.             strParam += ",screenX=" + nX + ",screenY=" + nY;
  1155.             window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
  1156.             if (gBsBrowser.ns4) {
  1157.                 window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
  1158.                 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1159.                 window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
  1160.             }
  1161.             else if (gBsBrowser.ie4)
  1162.             {
  1163.                 window.gPopupWindow.focus();
  1164.             }
  1165.         }
  1166.     }
  1167.  
  1168.     return;
  1169. }
  1170.  
  1171.  
  1172. function NonIEPopup_HandleBlur(e)
  1173. {
  1174.     window.gPopupWindow.focus();
  1175. }
  1176.  
  1177. function NonIEPopup_HandleClick(e)
  1178. {
  1179.     // Because navigator will give the event to the handler before the hyperlink, let's
  1180.     // first route the event to see if we are clicking on a Popup menu in a popup.
  1181.     document.routeEvent(e);
  1182.  
  1183.     // If a popup menu is active then don't do anything with the click
  1184.     if (window.gPopupWindow.gbInPopupMenu) {
  1185.         window.gPopupWindow.captureEvents(Event.CLICK);
  1186.         window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1187.         return false;
  1188.     }
  1189.  
  1190.     // Close the popup window
  1191.     if (e.target.href != null) {
  1192.         window.location.href = e.target.href;
  1193.         if (e.target.href.indexOf("BSSCPopup") == -1) {
  1194.             this.close();
  1195.         }
  1196.     } else {
  1197.         this.close();
  1198.     }
  1199.     return false;
  1200. }
  1201.  
  1202. function BSSCPopup_AfterLoad()
  1203. {
  1204.     if ((window.gPopupIFrame.document.readyState == "complete") &&
  1205.         (window.gPopupIFrame.document.body != null)) {
  1206.         BSSCPopup_ResizeAfterLoad();
  1207.     } else {
  1208.         setTimeout("BSSCPopup_AfterLoad()", 200);
  1209.     }
  1210. }
  1211.  
  1212.  
  1213. function BSSCPopup_ResizeAfterLoad()
  1214. {
  1215.     window.gPopupDivStyle.visibility = gBsStyVisHide;
  1216.  
  1217.     // Determine the width and height for the window
  1218.     var size = new BSSCSize(0, 0);
  1219.     BSSCGetContentSize(window.gPopupIFrame, size);
  1220.     var nWidth = size.x;
  1221.     var nHeight = size.y;
  1222.     _BSPSGetClientSize();
  1223.     if (nWidth > gBsClientWidth) {
  1224.         // Adjust the height by 1/3 of how much we are reducing the width
  1225.         var lfHeight = 1.0;
  1226.         lfHeight = (((nWidth / (gBsClientWidth - 20.0)) - 1.0) * 0.3333) + 1.0;
  1227.         lfHeight *= nHeight;
  1228.         nHeight = lfHeight;
  1229.         nWidth = gBsClientWidth - 20;
  1230.     }
  1231.     if (nHeight > gBsClientHeight * .67) {
  1232.         nHeight = gBsClientHeight / 2;
  1233.     }
  1234.     window.gPopupDivStyle.width = nWidth;
  1235.     window.gPopupDivStyle.height = nHeight;
  1236.  
  1237.     // Determine the position of the window
  1238.     var nClickX = window.gnPopupClickX;
  1239.     var nClickY = window.gnPopupClickY;
  1240.     var nTop = 0;
  1241.     var nLeft = 0;
  1242.  
  1243.     if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
  1244.         nTop = nClickY + 10;
  1245.     } else {
  1246.         nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
  1247.     }
  1248.     if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
  1249.         nLeft = nClickX;
  1250.     } else {
  1251.         nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
  1252.     }
  1253.     if (nTop <0) nTop  = 1;
  1254.     if (nLeft<0) nLeft = 1;
  1255.  
  1256.  
  1257.     window.gPopupDivStyle.left = nLeft;
  1258.     window.gPopupDivStyle.top = nTop;
  1259.  
  1260.     // Set the location of the background blocks
  1261.     window.gPopupShadow.style.left = 6;
  1262.     window.gPopupShadow.style.top = 6;
  1263.     window.gPopupShadow.style.width = nWidth;
  1264.     window.gPopupShadow.style.height = nHeight;
  1265.     window.gPopupTopic.style.width = nWidth;
  1266.     window.gPopupTopic.style.height = nHeight;
  1267.  
  1268.     if (gbMac) {
  1269.         // Total hack on the iMac to get the IFrame to position properly
  1270.         window.gPopupIFrameStyle.pixelLeft = 100;
  1271.         window.gPopupIFrameStyle.pixelLeft = 0;
  1272.         // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
  1273.         window.gPopupIFrame.window.BSSCOnLoad();
  1274.     }
  1275.     window.gPopupIFrameStyle.width = nWidth;
  1276.     window.gPopupIFrameStyle.height = nHeight;
  1277.  
  1278.     window.gPopupDivStyle.visibility = gBsStyVisShow;
  1279.  
  1280.     setTimeout("BSSCPopup_Timeout();", 100);
  1281.     return false;
  1282. }
  1283.  
  1284.  
  1285. function    BSSCSize(x, y)
  1286. {
  1287.     this.x = x;
  1288.     this.y = y;
  1289. }
  1290.  
  1291. function BSSCGetContentSize(thisWindow, size)
  1292. {
  1293.     if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
  1294.         return;
  1295.  
  1296.     if (gbMac) {
  1297.         size.x = 300;
  1298.         size.y = 300;
  1299.         return;
  1300.     }
  1301.  
  1302.     // Resize the width until it is wide enough to handle the content
  1303.     // The trick is to start wide and determine when the scrollHeight changes
  1304.     // because then we know a scrollbar is necessary. We can then go back
  1305.     // to the next widest size (for no scrollbar)
  1306.     size.x = 800;
  1307.     var y = 1;
  1308.     var x = 800;
  1309.  
  1310.     // This double resize causes the document to re-render (and we need it to)
  1311.     thisWindow.resizeTo(1, 1);
  1312.     thisWindow.resizeTo(1, 1);
  1313.     thisWindow.resizeTo(x, thisWindow.document.body.scrollHeight);
  1314.     thisWindow.resizeTo(x, thisWindow.document.body.scrollHeight);
  1315.     var miny = thisWindow.document.body.scrollHeight;
  1316.     size.y = miny;
  1317. //    alert('firstsizex :' + resizeInfo.RstX + "    firstsizey :" + resizeInfo.RstY);
  1318.     for (i = 7; i > 0; i--) {
  1319.         x = i * 100;
  1320.         thisWindow.resizeTo(x, miny);
  1321.         thisWindow.resizeTo(x, miny);
  1322. //        alert('testsizex :' + x + "    testsizey :" + miny);
  1323.         if ((thisWindow.document.body.scrollHeight > miny) ||
  1324.             (thisWindow.document.body.scrollWidth > x)) {
  1325.             x = (i + 1) * 100;
  1326.             thisWindow.resizeTo(x, y);
  1327.             thisWindow.resizeTo(x, y);
  1328.             size.x = thisWindow.document.body.scrollWidth + 20;
  1329.             size.y = thisWindow.document.body.scrollHeight + 20;
  1330.             break;
  1331.         }
  1332.     }
  1333.  
  1334.     // Handle absurd cases just in case IE flakes
  1335.     if (size.y < 100) {
  1336.         size.y = 100;
  1337.     }
  1338. //    alert('sizex :' + size.x + "    sizey :" + size.y);
  1339.     thisWindow.resizeTo(size.x, size.y);
  1340.     thisWindow.resizeTo(size.x, size.y);
  1341.  
  1342.     return;
  1343. }
  1344.  
  1345.  
  1346.  
  1347. function BSSCPopupParentClicked()
  1348. {
  1349.     BSSCPopupClicked();
  1350.     return;
  1351. }
  1352.  
  1353.  
  1354. function BSSCPopupClicked()
  1355. {
  1356.     if (!window.gbPopupTimeoutExpired) {
  1357.         return false;
  1358.     }
  1359.  
  1360.     if (gPopupIFrame.window.gbInPopupMenu) {
  1361.         return false;
  1362.     }
  1363.  
  1364.     // Give the user a message about javascript calls through objects.
  1365.     if ((gPopupIFrame.window.event != null) &&
  1366.         (gPopupIFrame.window.event.srcElement != null) &&
  1367.         (gPopupIFrame.window.event.srcElement.tagName == "A") &&
  1368.         (gPopupIFrame.window.event.srcElement.href.indexOf("javascript:") == 0) &&
  1369.         (gPopupIFrame.window.event.srcElement.href.indexOf(".") != -1)) {
  1370.         gPopupIFrame.window.event.cancelBubble = true;
  1371.         alert('Hyperlinks to objects do not work in popups.');
  1372.         return false;
  1373.     }
  1374.  
  1375.     if (gPopupIFrame.document) {
  1376.         gPopupIFrame.document.body.onclick = null;
  1377.     }
  1378.     document.onclick = null;
  1379.     document.onmousedown = null;
  1380.  
  1381.     // Simply hide the popup
  1382.     gPopupDivStyle.visibility = gBsStyVisHide;
  1383.  
  1384.     return true;
  1385. }
  1386.  
  1387.  
  1388. //trace the mouse over's position for hotspot
  1389. function  BSPSPopupOnMouseOver(event)
  1390. {
  1391.     if (gBsBrowser.ie4) {
  1392.         window.gnPopupClickX = event.clientX + document.body.scrollLeft;
  1393.         window.gnPopupClickY = event.clientY + document.body.scrollTop;
  1394.     } else if (gBsBrowser.ns4) {
  1395.         window.gnPopupClickX = event.pageX;
  1396.         window.gnPopupClickY = event.pageY;
  1397.     }
  1398. }
  1399.  
  1400. function BSSCHidePopupWindow()
  1401. {
  1402.     if (window.gPopupWindow != null) {
  1403.         if (gBsBrowser.ns4) {
  1404.             if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
  1405.                 window.gPopupWindow.close();
  1406.                 window.gPopupWindow = null;
  1407.             }
  1408.         }
  1409.     }
  1410.  
  1411.     return;
  1412. }
  1413.  
  1414. var gbPopupMenuTimeoutExpired = false;
  1415. var gbInPopupMenu = false;
  1416. var gbPopupMenuTopicList = null;
  1417.  
  1418. //////////////////////////////////////////////////////////////////////////////////////////
  1419. //
  1420. // Popup Menu code
  1421. //
  1422. //////////////////////////////////////////////////////////////////////////////////////////
  1423.  
  1424.  
  1425. function _WritePopupMenuLayer()
  1426. {
  1427.     document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1428.     if (gbNav4) {
  1429. //Do not try to write ininle styles for NS!  NS can not handle it and will not stop downloading the html page...
  1430. //        document.write(".PopupOver {color:white; background:navy; font-size:9pt; text-decoration:none;}");
  1431. //        document.write(".PopupNotOver {color:black; background:#c0c0c0; font-size:9pt; text-decoration:none;}");
  1432.     } else if (gbIE4) {
  1433.         document.write("<STYLE TYPE='text/css'>");
  1434.         if (gbMac) {
  1435.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; text-decoration:none;}");
  1436.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; text-decoration:none;}");
  1437.         } else {
  1438.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; text-decoration:none;}");
  1439.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; text-decoration:none;}");
  1440.         }
  1441.         document.write("</STYLE>");
  1442.     }
  1443. }
  1444.  
  1445. //Define variable arguments as: strTitle, strUrl
  1446. function PopupMenuTopicEntry() 
  1447. {
  1448.     this.strTitle = PopupMenuTopicEntry.arguments[0];
  1449.     this.strURL = PopupMenuTopicEntry.arguments[1];
  1450. }
  1451.  
  1452. // If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
  1453. function PopupMenu_SetTopicList(aPopupTopicArray)
  1454. {
  1455.     gbPopupMenuTopicList = aPopupTopicArray;
  1456. }
  1457.  
  1458. //Seek for the bsscright frame 
  1459. function _SeekFrameByName( cRoot, strName )
  1460. {
  1461.     if( cRoot == null )    return null;
  1462.     if( cRoot.frames == null )    return null;
  1463.     if( cRoot.frames[strName] != null )    return cRoot.frames[strName];
  1464.     for (var i=0; i<cRoot.frames.length; i++)
  1465.     {
  1466.         var cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
  1467.         if( cObj != null )        return cObj;
  1468.     };
  1469.     return null;
  1470. }
  1471. function _GetFrameByName( cRoot, strName )
  1472. {
  1473.     if( cRoot == null )    return null;
  1474.     var cRet = _SeekFrameByName(cRoot, strName);
  1475.     if( cRet != null )    return cRet;
  1476.     return _GetFrameByName( cRoot.parent, strName );
  1477. }
  1478.  
  1479. function _PopupMenu_Invoke(fn_arguments)
  1480. {
  1481.     if ((!gbIE4 && !gbNav4) || ((gbMac) && (gbIE4) && (window.event.srcElement.tagName == "AREA"))) {
  1482.     
  1483.         var argLen     = fn_arguments.length;
  1484.  
  1485.         // Create the window that the hyperlinks will go into
  1486.         var nHeight = argLen * 15;
  1487.         var nWidth = 400;
  1488.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1489.         strParam += ",height=" + nHeight + ",width=200";
  1490.         strParam += ",resizable";
  1491.  
  1492.         // Create a temporary window first to ensure the real popup comes up on top
  1493.         var wndTemp = window.open("", "temp", strParam);
  1494.  
  1495.         // Create the real popup window
  1496.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1497.  
  1498.         // Close the temporary
  1499.         wndTemp.close();
  1500.  
  1501.         wndPopupLinks.document.open("text/html");
  1502.         wndPopupLinks.document.write("<html><head></head>");
  1503.         wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");
  1504.         var strParaLine = "";
  1505.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1506.             strParaLine = "";
  1507.             strParaLine += "<a href=\"javascript:";
  1508.             if (gbIE) {
  1509.                 strParaLine += "onBlur=null; ";
  1510.             }
  1511.             strParaLine += "opener.location=\'";
  1512.             strParaLine += fn_arguments[2 * i + 3];
  1513.             strParaLine += "\';close();\"";
  1514.             if (fn_arguments[1] != '') {
  1515.                 strParaLine += " TARGET='" + fn_arguments[1] + "'";
  1516.             }
  1517.             strParaLine += ">";
  1518.             strParaLine += fn_arguments[2 * i + 2];
  1519.             strParaLine += "</a>";
  1520.             strParaLine += "<br>";
  1521.             wndPopupLinks.document.write(strParaLine);
  1522.         }
  1523.         wndPopupLinks.document.write("</body></html>");
  1524.         wndPopupLinks.document.close();
  1525.         window.gbInPopupMenu = true;
  1526.         if (!gbIE) {
  1527.             wndPopupLinks.focus();
  1528.         }
  1529.  
  1530.         return false;
  1531.     }
  1532.  
  1533.     // Make sure we have reasonable arguments
  1534.     var argLen = fn_arguments.length;
  1535.     if (argLen < 3) {
  1536.         return false;
  1537.     }
  1538.  
  1539.     // Check to see if we only have one target
  1540.     var strTarget = "";
  1541.     if (((argLen < 5) && (isNaN(fn_arguments[2]))) ||
  1542.         ((argLen < 4) && (!isNaN(fn_arguments[2])))) {
  1543.  
  1544.         // Get the place that we will be putting the topic into
  1545.         var targetDoc = null;
  1546.         if (fn_arguments[1] == '') {
  1547.             targetDoc = window.document;
  1548.         } else {
  1549.             targetDoc = _GetFrameByName( parent, fn_arguments[1] );
  1550.             if (targetDoc == null) {
  1551.                 targetDoc  = window.document;
  1552.             }
  1553.             //if (gbIE4) {
  1554.             //        targetDoc = eval("top.document.frames['" + fn_arguments[1] + "']");
  1555.             //    } else if (gbNav4) {
  1556.             //    targetDoc = eval("window.top." + fn_arguments[1] + ".document");
  1557.             //}
  1558.             strTarget = "TARGET='" + fn_arguments[1] + "'";
  1559.         }
  1560.         if (isNaN(fn_arguments[2])) {
  1561.             targetDoc.location.href = fn_arguments[3];
  1562.         } else {
  1563.             targetDoc.location.href = gbPopupMenuTopicList[fn_arguments[2]].strURL;
  1564.         }
  1565.         return false;
  1566.     }
  1567.     
  1568.     var strMenu = "";
  1569.     if (gbNav4) {
  1570.         strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
  1571.     } else {
  1572.         strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
  1573.         if (gbMac) {
  1574.             strMenu += ' CELLPADDING=4';
  1575.         } else {
  1576.             strMenu += ' CELLPADDING=2';
  1577.         }    
  1578.         strMenu += ' BGCOLOR=#c0c0c0>';
  1579.     }
  1580.  
  1581.     // Add each of the items
  1582.     var i = 2;
  1583.     while (i <= argLen - 1) {
  1584.         strMenu += '<TR><TD><NOBR>'
  1585.         // If the destination is a number then look it up in the topic list
  1586.         if (isNaN(fn_arguments[i])) {
  1587.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
  1588.         } else {
  1589.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
  1590.         }
  1591.         strMenu += ' onclick="PopupMenu_HandleClick(event);"';
  1592.         strMenu += ' onmouseover="PopupMenu_Over(event);"';
  1593.         strMenu += ' onmouseout="PopupMenu_Out(event);"';
  1594.         strMenu += '>';
  1595.         if (isNaN(fn_arguments[i])) {
  1596.             strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
  1597.         } else {
  1598.             strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
  1599.         }
  1600.         strMenu += '</A></DIV></NOBR></TD></TR>';
  1601.  
  1602.         if (isNaN(fn_arguments[i])) {
  1603.             i += 2;
  1604.         } else {
  1605.             i += 1;
  1606.         }
  1607.     }
  1608.     strMenu += "</TABLE>";
  1609.  
  1610.     var layerPopup = null;
  1611.     var stylePopup = null;
  1612.     var nEventX = 0;
  1613.     var nEventY = 0;
  1614.     var nWindowWidth = 0;
  1615.     if (gbIE4) {
  1616.  
  1617.         layerPopup = document.all["PopupMenu"];
  1618.         layerPopup.innerHTML = strMenu;
  1619.         stylePopup = layerPopup.style;
  1620.  
  1621.         _BSPSGetClientSize();
  1622.  
  1623.         // Get the position of the item causing the event (relative to its parent)
  1624.         //if (gbMac) {
  1625.         if (true) {
  1626.             nEventX = window.event.clientX;
  1627.             nEventY = window.event.clientY;
  1628.         } else {
  1629.             //??? YJ: Can not remember why we calculate envent position by following code...
  1630.             //but it is wrong in a case like: CENTER->P->TABLE:
  1631.             //the offset positions of TABLE, P and CENTER are same (same offsetTop,offsetLeft)
  1632.             //so we get triple times of offset of x and y as we expect... 
  1633.  
  1634.             nEventX = window.event.srcElement.offsetLeft - document.body.scrollLeft;
  1635.             nEventY = window.event.srcElement.offsetTop - document.body.scrollTop;
  1636.  
  1637.             // Get the location of the parent
  1638.             var nParentLocX = 0;
  1639.             var nParentLocY = 0;
  1640.  
  1641.             var ParentItem = window.event.srcElement.offsetParent;
  1642.             while (ParentItem != null) {
  1643.                 if (ParentItem.offsetLeft)    {
  1644.                     nParentLocX += ParentItem.offsetLeft;
  1645.                     nParentLocY += ParentItem.offsetTop;
  1646.                 }
  1647.                 ParentItem = ParentItem.parentElement;
  1648.             }
  1649.  
  1650.             // Adjust the location of the item using the location of the parent(s)
  1651.             nEventX += nParentLocX;
  1652.             nEventY += nParentLocY;
  1653.         }
  1654.  
  1655.         if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
  1656.             nEventY += document.body.scrollTop + 10;
  1657.         } else {
  1658.             nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
  1659.         }
  1660.         stylePopup.top = nEventY;
  1661.  
  1662.         if (nEventX + layerPopup.scrollWidth + 20 > gBsClientWidth) {
  1663.             if (gBsClientWidth - layerPopup.scrollWidth < 5) {
  1664.                 stylePopup.left = 5;
  1665.             } else {
  1666.                 stylePopup.left = gBsClientWidth - layerPopup.scrollWidth - 5;
  1667.             }
  1668.         } else {
  1669.             stylePopup.left = nEventX + document.body.scrollLeft + 20;
  1670.         }
  1671.  
  1672.         stylePopup.visibility = "visible";
  1673.         document.onclick = PopupMenu_HandleClick;
  1674.     } else if (gbNav4) {
  1675.         layerPopup = document.layers.PopupMenu;
  1676.         layerPopup.visibility = "hide";
  1677.         stylePopup = layerPopup.document;
  1678.         stylePopup.write(strMenu);
  1679.         stylePopup.close();
  1680.         var e = fn_arguments[0];
  1681.         nEventX = e.pageX;
  1682.         nEventY = e.pageY;
  1683.         _BSPSGetClientSize();
  1684.         if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
  1685.             nEventY += 20;
  1686.         } else {
  1687.             nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
  1688.         }
  1689.         layerPopup.top = nEventY;
  1690.  
  1691.         if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
  1692.             if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
  1693.                 nEventX = 5;
  1694.             } else {
  1695.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
  1696.             }
  1697.         } else {
  1698.             nEventX += 20;
  1699.         }
  1700.  
  1701.         layerPopup.left = nEventX;
  1702.  
  1703.         layerPopup.visibility = "show";
  1704.  
  1705. //        window.captureEvents(Event.CLICK | Event.MOUSEDOWN);
  1706.         window.captureEvents(Event.MOUSEDOWN);
  1707. //        window.onclick = PopupMenu_HandleClick;
  1708.         window.onmousedown = PopupMenu_HandleClick;
  1709.     }
  1710.  
  1711.     window.gbInPopupMenu = true;
  1712.     window.gbPopupMenuTimeoutExpired = false;
  1713.     setTimeout("PopupMenu_Timeout();", 100);
  1714.     return false;
  1715. }
  1716.  
  1717.  
  1718. function PopupMenu_Timeout()
  1719. {
  1720.     window.gbPopupMenuTimeoutExpired = true;
  1721. }
  1722.  
  1723. function PopupMenu_Over(e)
  1724. {
  1725.     if (gbIE4) {
  1726.         e.srcElement.className = "PopupOver";
  1727.     } else if (gbNav4) {
  1728. //        this.bgColor = "red";
  1729. //        e.target.document.className = "PopupOver";
  1730.     }
  1731.     return;
  1732. }
  1733.  
  1734. function PopupMenu_Out(e)
  1735. {
  1736.     if (gbIE4) {
  1737.         e.srcElement.className = "PopupNotOver";
  1738.     } else if (gbNav4) {
  1739.         this.bgColor = "#f0f0f0";
  1740.     }
  1741.     return;
  1742. }
  1743.  
  1744.  
  1745. function PopupMenu_HandleClick(e)
  1746. {
  1747.     if (!window.gbPopupMenuTimeoutExpired) {
  1748.         return;
  1749.     }
  1750.  
  1751.     window.gbInPopupMenu = false;
  1752.  
  1753.     if (gbNav4) {
  1754. //        window.releaseEvents(Event.CLICK);
  1755.         window.releaseEvents(Event.MOUSEDOWN);
  1756.     }
  1757.  
  1758.     var layerPopup = null;
  1759.     var stylePopup = null;
  1760.     if (gbIE4) {
  1761.         layerPopup = document.all["PopupMenu"];
  1762.         stylePopup = layerPopup.style;
  1763.         stylePopup.visibility = "hidden";
  1764.     } else if (gbNav4) {
  1765.         layerPopup = document.layers.PopupMenu;
  1766.         layerPopup.visibility = "hide";
  1767.     }
  1768.  
  1769.     return;
  1770. }
  1771.  
  1772. // This function should be deleted when all old projects are cleaned up
  1773. function BSPSWritePopupFrameForIE4()
  1774. {
  1775.     return false;
  1776. }
  1777.  
  1778. /////////////////////////////////////////////////////////////////////
  1779. function BSSCPopup_ClickMac()
  1780. {
  1781.     if ((!DHTMLPopupSupport()) && (gbIE4))
  1782.     {    
  1783.         var bClickOnAnchor = false;
  1784.         var el;
  1785.         if ((window.event != null) &&
  1786.             (window.event.srcElement != null))
  1787.         {
  1788.             el = window.event.srcElement;
  1789.             while (el != null)
  1790.             {
  1791.                 if ((el.tagName == "A") || (el.tagName == "AREA"))     {
  1792.                     bClickOnAnchor = true;
  1793.                     break;
  1794.                 }
  1795.                 if (el.tagName == "BODY") {
  1796.                     break;
  1797.                 }
  1798.                 el = el.parentElement;
  1799.             }
  1800.         }
  1801.         if (BSSCPopup_IsPopup())
  1802.         {
  1803.             if (!bClickOnAnchor) {
  1804.                 parent.window.gPopupWindow = null;
  1805.                 self.close();
  1806.             }
  1807.         }
  1808.         else
  1809.         {
  1810.             bClosePopupWindow = true;
  1811.             if ((bClickOnAnchor) &&
  1812.                 (el.href) &&
  1813.                 (el.href.indexOf("javascript:BSSCPopup") != -1))
  1814.             {
  1815.                 bClosePopupWindow = false;
  1816.             }
  1817.             if (bClosePopupWindow)
  1818.             {
  1819.                 if (window.gPopupWindow != null)
  1820.                 {
  1821.                     var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400";
  1822.                     window.gPopupWindow = window.open("", gstrPopupSecondWindowName,strParam);
  1823.                     window.gPopupWindow.close();
  1824.                     window.gPopupWindow = null;
  1825.                 }
  1826.             }
  1827.         }
  1828.     }
  1829.  }
  1830.  
  1831. //////////////////////////////////////////////////////////////////////
  1832.  
  1833. _BSPSGetBrowserInfo();
  1834.  
  1835. function _BSSCOnLoad()
  1836. {
  1837.     if (!gbIE4 && !gbNav4)
  1838.         return;
  1839.  
  1840.     // Make everything visible in navigator
  1841.     if (gbNav4) {
  1842.         // Make some special effects items visible
  1843.         for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  1844.             document.layers[iLayer].visibility = gBsStyVisShow;
  1845.             document.layers[iLayer].left = 0;
  1846.         }
  1847.     }
  1848.  
  1849.     // Remove the NavBar if necessary
  1850.     RemoveNavBar();
  1851.         
  1852.     // Don't continue without IE4
  1853.     if (gbIE4) {
  1854.         HHActivateComponents();
  1855.         doStaticEffects();
  1856.         startAnimationSet(0);
  1857.     }
  1858. }
  1859.  
  1860. function _BSSCOnUnload()
  1861. {
  1862. }
  1863.  
  1864. function _BSSCOnClick()
  1865. {
  1866.     if (!gbIE4)
  1867.         return;
  1868.  
  1869.     BSSCPopup_ClickMac();
  1870.     startNextAnimationSet();
  1871. }
  1872.  
  1873. //////////BSSCDHTML Section Embedded Code//////////
  1874. var s_strAgent = navigator.userAgent.toLowerCase();
  1875. var s_nVer       = parseInt(navigator.appVersion);
  1876.  
  1877. var s_bIE  = (s_strAgent.indexOf('msie') != -1);
  1878. var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
  1879. var s_bOpera    = (s_strAgent.indexOf('opera') != -1);
  1880.  
  1881. var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
  1882. var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));
  1883.  
  1884. var s_bNS2        = ((s_bNS) && (s_nVer <= 2));
  1885. var s_bNS3        = ((s_bNS) && (s_nVer == 3));
  1886. var s_bIE300301    = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
  1887. var s_bIE302    = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));
  1888.  
  1889.  
  1890. function HasExtJs()
  1891. {
  1892.     if (s_bIE3Before) { return false;}
  1893.     if (s_bNS3Before) {    return false;}
  1894.     if (typeof (_BSSCOnLoad) == "undefined"){ return false; }
  1895.     return true;
  1896. }
  1897.  
  1898. function BSSCOnLoad()
  1899. {
  1900.     if (HasExtJs()) { _BSSCOnLoad(); }
  1901. }
  1902.  
  1903. function BSSCOnUnload()
  1904. {
  1905.     if (HasExtJs()) { _BSSCOnUnload(); }
  1906. }
  1907.  
  1908. function BSSCOnClick()
  1909. {
  1910.     if (HasExtJs()) { _BSSCOnClick(); }
  1911. }
  1912.  
  1913. function WritePopupMenuLayer()
  1914. {
  1915.     if (HasExtJs()) {_WritePopupMenuLayer();}
  1916. }
  1917.  
  1918. function BSSCCreatePopupDiv()
  1919. {
  1920.     if (HasExtJs()) {_BSSCCreatePopupDiv();    }
  1921. }
  1922.  
  1923. function BSSCPopup(strURL)
  1924. {
  1925.     if (HasExtJs())    { 
  1926.         _BSSCPopup(strURL);
  1927.     }else{
  1928.         //Create a temporary window first to ensure the real popup comes up on top
  1929.         var wndTemp = null;
  1930.         if (!s_bNS3) {
  1931.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1932.         }
  1933.         // Create the real popup window
  1934.         var wndPopup = window.open(strURL, "PopupWindow", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
  1935.         // Close the temporary
  1936.         if (!s_bNS3) {
  1937.             wndTemp.close();
  1938.         } else {
  1939.             wndPopup.focus();
  1940.         }
  1941.     }
  1942. }
  1943.  
  1944.  
  1945. function PopupMenu_Invoke()
  1946. {
  1947.     if (HasExtJs()) {
  1948.         return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
  1949.     }
  1950.     if (s_bNS3Before || s_bIE3Before )    {
  1951.         var argLen     = PopupMenu_Invoke.arguments.length;
  1952.         if (argLen < 5) {
  1953.             window.document.location.href = PopupMenu_Invoke.arguments[3];
  1954.             return false;
  1955.         }
  1956.         var nHeight = argLen * 15;
  1957.         var nWidth = 400;
  1958.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1959.         strParam += ",height=" + nHeight + ",width=200,resizable";
  1960.         
  1961.         //Create a temporary window first to ensure the real popup comes up on top
  1962.         var wndTemp = null;
  1963.         if (!s_bNS3) {
  1964.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  1965.         }
  1966.  
  1967.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1968.         wndPopupLinks.document.open("text/html");
  1969.         wndPopupLinks.document.write("<html><head>");
  1970.         if (s_bNS2 || s_bOpera) {
  1971.             wndPopupLinks.document.write("<base href=\"" + location +"\">");
  1972.         } else {
  1973.             //YJ: IE301,302 and NS3.x works fine
  1974.             wndPopupLinks.document.write("<");
  1975.             wndPopupLinks.document.write("script>");
  1976.             wndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
  1977.             wndPopupLinks.document.write("<");
  1978.             wndPopupLinks.document.write("/script>");
  1979.         }
  1980.         wndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
  1981.         var strParaLine = "";
  1982.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1983.             strParaLine = "";
  1984.             if (s_bNS2 || s_bOpera){
  1985.                 strParaLine += "<a href=\"";
  1986.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1987.                 strParaLine += "\">"
  1988.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  1989.                 strParaLine += "</a>";
  1990.             } else {
  1991.                 strParaLine += "<a href=\"javascript:";
  1992.                 strParaLine += "gotoUrl(\'";
  1993.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  1994.                 strParaLine += "\');\"";
  1995.                 if (PopupMenu_Invoke.arguments[1] != '') {
  1996.                     strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
  1997.                 }
  1998.                 strParaLine += ">";
  1999.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2000.                 strParaLine += "</a>";
  2001.             }
  2002.             strParaLine += "<br>";
  2003.             wndPopupLinks.document.write(strParaLine);
  2004.         }
  2005.         wndPopupLinks.document.write("</body></html>");
  2006.         wndPopupLinks.document.close();
  2007.  
  2008.         // Close the temporary
  2009.         if (!s_bNS3) {
  2010.             wndTemp.close();
  2011.         }else {
  2012.             wndPopupLinks.focus();
  2013.         }
  2014.  
  2015.         return true;
  2016.     }
  2017.     return false;
  2018. }
  2019.   
  2020.